package singleton;

public class SyncSingleton {
    private static SyncSingleton instance = null;

    private SyncSingleton() {
        System.out.println("SyncSingleton");
    }

    public static SyncSingleton getInstance() {
        if (instance == null) {
            synchronized (SyncSingleton.class) {
                if (instance == null) {
                    instance = new SyncSingleton();
                }
            }
        }
        return instance;
    }
}